<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 1.String.fromCodePoint(unicode):获取指定unicode编码对应的字符串
    console.log(String.fromCodePoint(0x1F600));
    // 2.str.codePointAt(index):获取指定位置的unicode编码
    console.log("ABC".codePointAt(0));//65
    // 3.normalize():将字符串转换为规范的格式
    // 4.includes(str):判断字符串中是否存在指定字符
    console.log("abc".includes("a"));
    // 5.startsWith(str):判断字符串是否以指定字符开头
    console.log("abc".startsWith("a"));
    // 6.endsWith(str):判断字符串是否以指定的字符结尾
    console.log('abc'.endsWith('c'));
    // 7.repeat(num):重复字符串num次
    console.log('$'.repeat(5));
    // 8.padStart(num,str):字符串总长度为num,长度不足左边填充str字符
    console.log('hello'.padStart(10, '*'));
    // 9.padEnd(num,str):字符串总长度为num,长度不足右边填充str字符
    console.log('hello'.padEnd(10, '*'));
  </script>
</body>
</html>